package pers.gxm.state;

public class NightState implements State{
    private static NightState nightState = new NightState();
    private NightState(){}
    public static NightState getInstance(){
        return nightState;
    }
    @Override
    public void doClock(Context context, int hour) {
        if(hour >=8 && hour < 12 || hour > 12 && hour <= 20){
            context.changeState(DayState.getInstance());
            return;
        }
        if(hour == 12){
            context.changeState(LunchState.getInstance());
        }
    }

    @Override
    public void doUse(Context context) {
//            doAlarm(context);
        context.callSecurityCenter("警告！晚上正在使用金库");
    }


    @Override
    public void doAlarm(Context context) {
        context.callSecurityCenter("按下警铃（晚上）");
    }

    @Override
    public void doPhone(Context context) {
        context.recording("(晚上)不能使用电话，请留言");
    }
}
